import Mock from 'mockjs'
let List = []
export default {
  getHomeData() {
    for (let i = 0; i < 7; i++) {
      List.push(
        Mock.mock({
          vue: Mock.Random.float(100, 8000, 0, 2),
          wechat: Mock.Random.float(100, 8000, 0, 2),
          ES6: Mock.Random.float(100, 8000, 0, 2),
          Redis: Mock.Random.float(100, 8000, 0, 2),
          React: Mock.Random.float(100, 8000, 0, 2),
          springboot: Mock.Random.float(100, 8000, 0, 2),
        }),
      )
    }
    return {
      code: 20000,
      data: {
        orderData: {
          data: List,
          date: ['20191001', '20191002', '20191003', '20191004', '20191005', '20191006', '20191007'],
        },
        videoData: [
          {
            name: 'SpringBoot',
            value: Mock.Random.float(1000, 10000, 0, 2),
          },
          {
            name: 'Vue',
            value: Mock.Random.float(1000, 10000, 0, 2),
          },
          {
            name: '小程序',
            value: Mock.Random.float(1000, 10000, 0, 2),
          },
          {
            name: 'Html',
            value: Mock.Random.float(1000, 10000, 0, 2),
          },
          {
            name: 'ES6',
            value: Mock.Random.float(1000, 10000, 0, 2),
          },
          {
            name: 'Java',
            value: Mock.Random.float(1000, 10000, 0, 2),
          },
        ],
        userData: [
          { date: '周一', new: Mock.Random.integer(1, 100), active: Mock.Random.integer(100, 1000) },
          { date: '周二', new: Mock.Random.integer(1, 100), active: Mock.Random.integer(100, 1000) },
          { date: '周三', new: Mock.Random.integer(1, 100), active: Mock.Random.integer(100, 1000) },
          { date: '周四', new: Mock.Random.integer(1, 100), active: Mock.Random.integer(100, 1000) },
          { date: '周五', new: Mock.Random.integer(1, 100), active: Mock.Random.integer(100, 1000) },
          { date: '周六', new: Mock.Random.integer(1, 100), active: Mock.Random.integer(100, 1000) },
          { date: '周日', new: Mock.Random.integer(1, 100), active: Mock.Random.integer(100, 1000) },
        ],
        BuyData: [
          {
            name: 'SpringBoot',
            value: Mock.Random.integer(1000, 10000),
          },
          {
            name: 'Vue',
            value: Mock.Random.integer(1000, 10000),
          },
          {
            name: '小程序',
            value: Mock.Random.integer(1000, 10000),
          },
          {
            name: 'Html',
            value: Mock.Random.integer(1000, 10000),
          },
          {
            name: 'ES6',
            value: Mock.Random.integer(1000, 10000),
          },
          {
            name: 'Java',
            value: Mock.Random.integer(1000, 10000),
          },
        ],
      },
    }
  },
}
